import request from "../utils/request"
import qs from "querystring"

export const findByDept =(deptId)=>{
    return request.get("/dept/by/deptId?deptId="+deptId);
}

export const findAllRegion = ()=>{
    return request.get("/region/all");
}

export const getRegionByPage = (query)=>{
    return request.get("/region/by/pageHelper",{
        params:query,
        paramsSerializer:(param)=>{
            return qs.stringify(param);  //key=value&key=value
        }
    })
}

export const saveOrUpdateRegion = (data)=>{
    return request.post("/region/region",data);
}

export const deleteRegionById = (id) => {
    return request.delete("/region/"+id);
} 

export const deleteRegionByBatch = (ids)=>{
    return request.delete("/region/batch?ids="+ids)
}